<template>
  <RouterView />
</template>

<script setup lang="ts">
import { RouterView, useRoute } from "vue-router";
import { watch } from "vue";

const route = useRoute();

watch(
  route,
  (to) => {
    if (to.meta.title) {
      document.title = String(to.meta.title);
    } else {
      document.title = import.meta.env.VITE_APP_TITLE;
    }
  },
  { immediate: true }
);
</script>
